﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ASCalpuff.FileLayers
{

    /// <summary>
    /// 其他干沉积参数
    /// 多种干沉积参数 地表面阻力参数，污染物质相互反应参数及植被覆盖情况等
    /// </summary>
    public class PG9:Group
    {
        /// <summary>
        /// 参考表皮阻力Reference cuticle resistance (s/cm) 
        /// </summary>
        double m_RCUTR = 30;

        public double RCUTR
        {
            get { return m_RCUTR; }
            set { m_RCUTR = value; }
        }



        /// <summary>
        /// 参考地面阻力Reference ground resistance (s/cm)
        /// </summary>
        double m_RGR = 10;


        public double RGR
        {
            get { return m_RGR; }
            set { m_RGR = value; }
        }



        /// <summary>
        /// 参考污染物反应性Reference pollutant reactivity
        /// </summary>
        double m_REACTR = 8;

        public double REACTR
        {
            get { return m_REACTR; }
            set { m_REACTR = value; }
        }



        /// <summary>
        /// 用来估算有效颗粒物沉积速度的颗粒物大小的间隔区域的数量
        /// </summary>
        int m_NINT = 9;

        public int NINT
        {
            get { return m_NINT; }
            set { m_NINT = value; }
        }


        /// <summary>
        ///  在非灌溉区定义植被状态的标记
        /// 1=活性无应力的植被
        /// 2=活性有应力植被
        /// 3=没有活性的植被
        /// </summary>
        int m_IVEG = 1;

        public int IVEG
        {
            get { return m_IVEG; }
            set { m_IVEG = value; }
        }

        public override void ReadFromGroup(Dictionary<string, string> dic)
        {
            foreach (KeyValuePair<string, string> m_dic in dic)
            {

                if (m_dic.Key == "RCUTR")
                {
                    this.RCUTR = Convert.ToDouble(m_dic.Value);
                }
                if (m_dic.Key == "RGR")
                {
                    this.RGR = Convert.ToDouble(m_dic.Value);
                }
                if (m_dic.Key == "REACTR")
                {
                    this.REACTR = Convert.ToDouble(m_dic.Value);
                }
                if (m_dic.Key == "NINT")
                {
                    this.NINT = Convert.ToInt32(m_dic.Value);
                }

                if (m_dic.Key == "IVEG")
                {
                    this.IVEG = Convert.ToInt32(m_dic.Value);
                }

            }
        }

        public override string WriteToGroup()
        {
            string ResultStr = "", TempStr = "";

            TempStr = StrWriter.GetCLine();
            TempStr += "INPUT GROUP: 9 -- Miscellaneous dry deposition parameters" + "\r\n";
            ResultStr += TempStr;

            TempStr = StrWriter.GetCLine();
            ResultStr += TempStr;

            TempStr = "! RCUTR  =  " + RCUTR.ToString() + " !" + "\r\n";
            ResultStr += TempStr;

            TempStr = "! RGR  =  " + RGR.ToString() + " !" + "\r\n";
            ResultStr += TempStr;

            TempStr = "! REACTR  =  " + REACTR.ToString() + " !" + "\r\n";
            ResultStr += TempStr;

            TempStr = "! NINT  =  " + NINT.ToString() + " !" + "\r\n";
            ResultStr += TempStr;

            TempStr = "! IVEG  =  " + IVEG.ToString() + " !" + "\r\n";
            ResultStr += TempStr;

            ResultStr += "!END!" + "\r\n";

            return ResultStr;
        }

    }


}
